if SERVER then AddCSLuaFile( "PVP.lua" ) end

local GM = IMiniGame.New();
GM["Info"] = {
	["Name"] = "PVP",
	["Version"] = "1.0",
	["up_date"] = "21 November 2010",
	["Author"] = {
		["Name"] = "Ningaglio",
		["Email"] = "Ningaglio@CitronGamers.com",
		["URL"] = "http://www.citrongamers.com"
	},
	["Info"] = "A Simple PVP MiniGame",
	["Description"] = "Kill everyone and enjoy more ammo!",
	["Icon"] = "gui/silkicons/bomb"
}

function GM.Functions.OnPreLoad()
	for k,v in pairs( player.GetAll() ) do
		v:SetFrags( 0 )
	end
	return true
end

function GM.Functions.OnUnload()
	for k,v in pairs( player.GetAll() ) do
		v:SetFrags( 0 )
	end
	return true
end

function GM.Hooks.PlayerLoadout( pl )
	pl:GiveAmmo(30,"buckshot",true);
	pl:Give("weapon_shotgun");
	pl:Give("weapon_crowbar");
	pl:SetVelocity( Vector( 0, 0, 50 ) * 10 );
	return true
end

function GM.Hooks.PlayerDeath( victim, weapon, killer )
	if victim:IsValid() and killer:IsValid() then
		if killer:IsPlayer() then
			killer:GiveAmmo(30,"buckshot", true);
		end
	end
end

function GM.Hooks.PlayerHurt( pl ) pl:SetVelocity( Vector( 0, 0, 50 ) * 10 ) end
function GM.Hooks.SpawnMenuEnabled() return false end
function GM.Hooks.SpawnMenuOpen() return false end
function GM.Hooks.ContextMenuOpen() return false end
function GM.Hooks.PopulateToolMenu() return false end
function GM.Hooks.PlayerNoClip() return false end
function GM.Hooks.CanPlayerSuicide() return false end

GM:Register()